<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_films
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

/**
 * @package		Joomla.Site
 * @subpackage	mod_films
 * @since		1.5
 */
class modFilmsHelper
{	
	public static function getArticlesByAlias($artAlias){
		$dbo = JFactory::getDbo();
		$queryStr = "SELECT cont.id, cont.catid, cont.introtext, cont.title, cont.production, "
				.	"cont.directed_by, cont.coproduction, cont.film_version, cont.length, cont.trailer, cont.poster"
				.	" FROM #__content as cont"
				.	" WHERE cont.alias = '".$artAlias."' AND state='1'";
		$dbo->setQuery($queryStr);
		$rows = $dbo->loadObject();
		return $rows;
	}
	
	public static function getArticlesDefault($defaultID) {
		$dbo = JFactory::getDbo();
		$queryStr = "SELECT cont.id, cont.catid, cont.introtext, cont.title, cont.production, "
				.	"cont.directed_by, cont.coproduction, cont.film_version, cont.length, cont.trailer, cont.poster"
				.	" FROM #__content as cont"
						.	" WHERE cont.id = '".$defaultID."' AND state='1'";
		$dbo->setQuery($queryStr);
		$rows = $dbo->loadObject();
		return $rows;
	}
}
